/*******************************************************************************
*                                                                              *
* This file provides functions implementation for an Artifical Immune System   *
*                                                                              *
*******************************************************************************/

#ifndef __AIS_PLUGIN_H__
#define __AIS_PLUGIN_H__

////////////////////////////////////////////////////////////////////////////////
// Includes
////////////////////////////////////////////////////////////////////////////////

#include "SCSystem.hpp"
#include "SC_AISO_LibConfig.h"

////////////////////////////////////////////////////////////////////////////////
// Prototypes
////////////////////////////////////////////////////////////////////////////////

/**
 *	Initialises the plugin.
 *	This function is called when a plugin is loaded to initialise some data
 *	(like loading a file) before computation starts.
*/
LIBRARY_DECL void InitPlugin (const std::string &);

/**
 *	Closes the plugin properly.
 *	This function is called when a plugin is closed to finalise some data (like 
 *	closing a file or free memory) when computation ends.
*/
LIBRARY_DECL void ClosePlugin (void);

/**
 *	Transforms waste into food.
 *	@param sys1 System 1 : Universe
 *	@param context Context system : WasteRecycling
 *	@param sys2 System 2 : Waste
*/
LIBRARY_DECL bool RecycleWaste (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

/**
 *	Injects food into the organism and turn food into cell.
 *	@param sys1 System 1 : Food
 *	@param context Context system : Absorption
 *	@param sys2 System 2 : Organism
*/
LIBRARY_DECL bool Absorb (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

/**
 *	Binds cell the surface if data allows it.
 *	@param sys1 System 1 : Cell (alive)
 *	@param context Context system : Growth
 *	@param sys2 System 2 : Adhesion surface
*/
LIBRARY_DECL bool Grow (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

/**
 *	Increases the age of the Food/Surface/Signal system.
 *	@param sys1 System 1 : Food/Surface/Signal (alive)
 *	@param context Context system : Decay
 *	@param sys2 System 2 : Time
*/
LIBRARY_DECL bool Decay (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

/**
 *	Splits the cell from the adhesion surface.
 *	@param sys1 System 1 : Cell (dead)
 *	@param context Context system : Split
 *	@param sys2 System 2 : Adhesion surface
*/
LIBRARY_DECL bool Split (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

/**
 *	Recycles a dead cell into an adhesion surface or a danger signal.
 *	@param sys1 System 1 : Cell (dead)
 *	@param context Context system : CellRecycling
 *	@param sys2 System 2 : Organism
*/
LIBRARY_DECL bool RecycleCell (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

/**
 *	Expels the dead adhesion surface/danger signal as waste.
 *	@param sys1 System 1 : Adhesion surface/Danger signal (dead)
 *	@param context Context system : Expelling
 *	@param sys2 System 2 : Organism
*/
LIBRARY_DECL bool Expel (SC::SCSystem &, const SC::SCSystem &, SC::SCSystem &);

////////////////////////////////////////////////////////////////////////////////

#endif
